import axios from 'axios';
import router from '../router';

const service = axios.create({});

service.interceptors.response.use(

    response => {
        if (response.status === 200) {
            if (response.data == '20010') {
                router.push("/login")
            } else {
                return response;
            }

        } else {
            return Promise.reject();
        }
    },
    error => {
        return Promise.reject();
    }
);

export default service;